home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / headers / gdevice.h < prev    next >
Encoding:
Text File  |  2000-06-23  |  3.0 KB  |  98 lines

  1. /*
  2.     File:        GDevice.h
  3.  
  4.     Contains:    TGDevice is a GDevice utility class, finding out GDevice information.
  5.                   GDevice.h contains the header file information for the TGDevice class.
  6.  
  7.     Written by: Kent Sandvik    
  8.  
  9.     Copyright:    Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24. // Declare label for this header file
  25. #ifndef _GDEVICE_
  26. #define _GDEVICE_
  27.  
  28. #ifndef _DTSCPLUSLIBRARY_
  29. #include "DTSCPlusLibrary.h"
  30. #endif
  31.  
  32. //    Toolbox Include Files
  33. #ifndef __TOOLUTILS__
  34. #include <ToolUtils.h>
  35. #endif
  36.  
  37. #ifndef __QUICKDRAW__
  38. #include <Quickdraw.h>
  39. #endif
  40.  
  41.  
  42. // _________________________________________________________________________________________________________ //
  43. //    Class Interface
  44.  
  45. class TGDevice
  46. // TGDevice is a simple information class which will provide GDevice information, style
  47. // base address of the GDevice, the rowbytes information, and the depth of each
  48. // screen connected to the system. It will wrap around at the end of the GDList
  49. // to the first GDevice.
  50. {
  51. public:
  52.     //    CONSTRUCTORS & DESTRUCTORS
  53.     TGDevice();                                    // basic constructor
  54.     virtual~ TGDevice();                        // virtual destructor
  55.  
  56.     //  ITERATORS
  57.     virtual void Next();                        // get next GDevice
  58.     virtual void First();                        // first value
  59.     virtual Boolean Last() const;                // last GDevice?
  60.  
  61.     //    PUBLIC ACCESSORS AND MUTATORS
  62.     virtual Ptr GetBase() const;                // get address to base
  63.     virtual long GetRow() const;                // get N row value
  64.     virtual short GetDepth() const;                // get depth value
  65. protected:
  66.     virtual void GetGDeviceValues();            // get the GDevice values
  67.  
  68. protected:
  69.     //    INITIATION ROUTINES                            
  70.     virtual Boolean IGDevice();                    // initialize needed class information
  71.  
  72. private:
  73.     //    FIELDS
  74.     GDHandle fGDList;                            // the list of GDevices in the system
  75.     GDHandle fFirstGDList;                        // the first one we encounter (used for wrap)
  76.     Boolean fState;                                // state for the class
  77.     Boolean fFirstTime;                            // signals constructor state
  78.     Boolean fLast;                                // used to signal the last entry
  79.     Ptr fBase;                                    // base address of the GDevice
  80.     long fRow;                                    // row information
  81.     short fDepth;                                // depth information
  82. };
  83.  
  84.  
  85. #endif
  86.  
  87. // _________________________________________________________________________________________________________ //
  88.  
  89.  
  90. /*    Change History (most recent last):
  91.   No        Init.    Date        Comment
  92.   1            khs        6/2/92        New file
  93.   2            khs        7/5/92        First decent release
  94.   3            khs        9/7/92        Changed the structure of the classes
  95. */
  96.  
  97.  
  98.